﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Runtime.Serialization;
using System.Collections;

namespace SchemaMonitor.json
{
    [DataContract]
    public class CFieldDate : CField
    {
        //Members
        [DataMember(Order = 1)]
        public List<DateTime> Dates;

        //Constructor
        public CFieldDate(CNodeBasic parent, CTag tag, object value) : base(parent, tag)
        {
            this.Value = value;
        }

        //Serialisation Constructors
        private CFieldDate() { }
        static CFieldDate() { ProtoBuf.Serializer.PrepareSerializer<CFieldDate>(); }

        //Must Override
        public override IList List { get { return Dates; } set { Dates = value.Cast<DateTime>().ToList(); } }
        protected override IList InitList() { return new List<DateTime>(); }
        protected override IList InitList(object[] array) { return array.Cast<DateTime>().ToList(); }

    }
}
